<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title>后台管理 - 易买网</title>
    <link type="text/css" rel="stylesheet" href="../css/style.css"/>
    <script type="text/javascript" src="../scripts/function-manage.js"></script>
</head>
<body>
<div class="main">
    <h2>留言管理</h2>
    <div class="manage">
        <table class="list">
            <tr>
                <th>ID</th>
                <th>姓名</th>
                <th>留言内容</th>
                <th>状态</th>
                <th>操作</th>
            </tr>
            <c:forEach items="${leaveMessageList}" var="n">
                <tr>
                    <td align="center">${n.leaveId}</td>
                    <td align="center">${n.user.username}</td>
                    <td align="center">${n.leaveContent}</td>
                    <td align="center"><c:if test="${n.replycontent=='0'}"><a href="ToLeaveMessageServlet?name1=${n.user.username}&name2=${n.leaveContent}&name3=${n.leaveId}">未回复</a></c:if>
                        <c:if test="${n.replycontent!='0'}"><a href="ToLeaveMessageServlet?name1=${n.user.username}&name2=${n.leaveContent}&name3=${n.leaveId}">已回复</a></c:if>
                    </td>
                    <td align="center"><a onclick="javascript:return confirm('你确定删除内容')" href="DelLeaveMessageServlet?name=${n.leaveId}" >删除</a></td>
                </tr>
            </c:forEach>
        </table>
        <div class="pager">
            <tr>
                <td colspan="5" align="center">
                    <a href="GetLeaveMessageServlet?pageIndex=1">首页</a>|
                    <a href="GetLeaveMessageServlet?pageIndex=${pageIndex-1}">上一页</a>
                    <a href="GetLeaveMessageServlet?pageIndex=${pageIndex+1}">下一页</a>|
                    <a href="GetLeaveMessageServlet?pageIndex=${totalPages}">尾页</a>
                </td>
            </tr>
        </div>
    </div>
</div>
</body>
</html>
